package com.bawei.mall.search.rabbit;

import com.alibaba.fastjson.JSONObject;
import com.bawei.common.rabbit.constant.QueueConstant;
import com.bawei.common.rabbit.domain.Message;
import com.bawei.mall.product.domain.reponse.ProductInfoResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Configuration;


/**
 * @author 蒋柏林
 * @version 1.0
 * @project mall-cloud
 * rabbit 测试
 * @date 2022/10/21 20:05:36
 */
@Configuration
public class RabbitTest {

    /**
     * 日志
     */
    private static final Logger log = LoggerFactory.getLogger(RabbitTest.class);

    /**
     * 接受测试消息
     * @param msg
     */
    @RabbitListener(queues = QueueConstant.TEST_NAME)
    public void listen(Message<ProductInfoResponse> msg) {
        log.info(JSONObject.toJSONString(msg));
    }

}
